package com.chuangjiangx.member.basic.ddd.domain.model;

/**
 * @author cj-ch
 * @date 2018/1/23 下午6:03
 */
public enum  MbrUserMappingType {
    WX("微信", (byte) 0),
    ALIPAY("支付宝", (byte) 1);

    public final String name;
    public final byte value;

    MbrUserMappingType(String name, byte value) {
        this.name = name;
        this.value = value;
    }

    public static MbrUserMappingType fromValue(byte value) {
        for (MbrUserMappingType type : MbrUserMappingType.values()) {
            if (type.value == value) {
                return type;
            }
        }
        return null;
    }
}
